package com.zzxz.practicaltrainingsys.service.impl;

import com.zzxz.practicaltrainingsys.entity.Major;
import com.zzxz.practicaltrainingsys.mapper.MajorMapper;
import com.zzxz.practicaltrainingsys.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MajorServiceImpl implements MajorService {
    @Autowired
    private MajorMapper majorMapper;

    @Override
    public List<Major> getMajor() {
        return majorMapper.getMajor();
    }

    @Override
    public boolean addMajor(Major major) {
        return majorMapper.addMajor(major) > 0;
    }

    @Override
    public Major getMajorById(Integer major_id) {
        return majorMapper.getMajorById(major_id);
    }

    @Override
    public int updateMajor(Major major) {
        return majorMapper.updateMajor(major);
    }

    @Override
    public List<Major> getMajorByCollegeId(Integer college_id) {
        return majorMapper.getMajorByCollegeId(college_id);
    }
}